package main

import (
	"fmt"
	"strings"
)

func main() {

	demo()
}

// 统计单词个数
func demo() {
	str := "hello,world,hello,ppp,qqq"
	fmt.Println(str)

	// 字符串转换为切片
	slice := strings.Split(str, ",")
	fmt.Println(slice)

	makeMap := make(map[string]int)
	for _, v := range slice {
		makeMap[v]++
	}
	fmt.Println(makeMap)
}
